import { Entity, Column, PrimaryGeneratedColumn } from 'typeorm';
import { ItemStatus, ItemShow, ItemType } from '../enum/dbParams';

@Entity()
export class VoteItem {
	@PrimaryGeneratedColumn()
	i_id: number;
	@Column({
		length: 100
	})
	i_title: string;
	@Column({
		type: 'int',
		width: 10
	})
	i_createtime: number;
	@Column({
		type: 'int',
		width: 10
	})
	i_starttime: number;
	@Column({
		type: 'int',
		width: 10
	})
	i_endtime: number;
	@Column({
		type: 'int',
		width: 10,
		default: null
	})
	i_modifytime: number;
	@Column({
		type: 'enum',
		enum: ItemType
	})
	i_type: ItemType;
	@Column({
		type: 'enum',
		enum: ItemStatus,
		default: ItemStatus.NORMAL
	})
	i_status: ItemStatus;
	@Column({
		type: 'enum',
		enum: ItemShow,
		default: ItemShow.DISABLE
	})
	i_show: ItemShow;
	@Column()
	i_options: string;
	@Column()
	u_id: number;
}
